﻿@model GaclibWebPage.Models.IndividualDemoModel
           
@{
    ViewBag.Title = "GacLib - Demos - " + Model.Title;
}
<script type="text/javascript" src="@Url.Content("~/Content/SyntaxHighlighter/scripts/shCore.js")" ></script>
<script type="text/javascript" src="@Url.Content("~/Content/SyntaxHighlighter/scripts/shBrushCpp.js")" ></script>
<script type="text/javascript" src="@Url.Content("~/Content/SyntaxHighlighter/scripts/shBrushXml.js")" ></script>
<script type="text/javascript" src="@Url.Content("~/Content/SyntaxHighlighter/scripts/shBrushPlain.js")"></script>
<link rel="Stylesheet" type="text/css" href="@Url.Content("~/Content/SyntaxHighlighter/styles/shCore.css")" />
<link rel="Stylesheet" type="text/css" href="@Url.Content("~/Content/SyntaxHighlighter/styles/shThemeRDark.css")" />
<tr>
    <td align="left" valign="top" colspan="6">
        <h1>@Model.Title</h1>
        <p>@Model.Description</p>
        <p><strong>This demo contains the following screenshots:</strong></p>
        @foreach (var image in Model.Images)
        {
            <img src="@Url.Content(string.Format("~/Content/Demos/{0}/{1}", Model.Name, image))" />
        }
        <p><strong>This demo contains the following code files:</strong></p>
        <ul>
            @foreach (var cppName in Model.CppCodes.Keys)
            {
                string fileName = Path.GetFileName(cppName);
                string anchorName = fileName.ToUpper().Replace('.', '_');
                <li><a href="#@anchorName">@fileName</a></li>
            }
        </ul>
        @foreach (var cppName in Model.CppCodes.Keys)
        {
            string fileName = Path.GetFileName(cppName);
            string anchorName = fileName.ToUpper().Replace('.', '_');
            string ext = Path.GetExtension(fileName).Substring(1);
            switch(ext)
            {
                case "h":
                    ext = "cpp";
                    break;
                case "bat":
                    ext = "text";
                    break;
            }
            <strong><a name="@anchorName">@fileName</a></strong>
            <div class="CppCode"><pre class="brush: @ext; gutter: false;">@Model.CppCodes[cppName]</pre></div>
        }
    </td>
</tr>
<script type="text/javascript">
    SyntaxHighlighter.all()
</script>